package org.demo.vo.daomapping;

import org.demo.vo.bean.Customer;
import org.telosys.persistence.mapping.AttributeMapping;
import org.telosys.persistence.mapping.BooleanMappedToInt;
import org.telosys.persistence.mapping.EntityMapping;

public class CustomerMapping extends EntityMapping<Customer>
{
	private final static Class<Customer> entityClass = Customer.class ;

	private final static String   table   = "CUSTOMER" ;

	private final static String   schema  = null ;  // Can be null if not required by the database
	
	private final static AttributeMapping[] attributesMapping = new AttributeMapping[]
	{
		new AttributeMapping("code",        "CODE",         true,  false, 0 ), // PK, not auto-incremented
		new AttributeMapping("countryCode", "COUNTRY_CODE", false, false, 0 ),
		new AttributeMapping("firstName",   "FIRST_NAME",   false, false, 0 ),
		new AttributeMapping("lastName",    "LAST_NAME",    false, false, 0 ),
		new AttributeMapping("login",       "LOGIN",        false, false, 0 ),
		new AttributeMapping("password",    "PASSWORD",     false, false, 0 ),
		new AttributeMapping("age",         "AGE",          false, false, 0 ),
		new AttributeMapping("city",        "CITY",         false, false, 0 ),
		new AttributeMapping("zipCode",     "ZIP_CODE",     false, false, 0 ),
		new AttributeMapping("phone",       "PHONE",        false, false, 0 ),
		new AttributeMapping("reviewer",    "REVIEWER",     false, false, 0, new BooleanMappedToInt(1,0) )
	};
	
	public CustomerMapping() 
	{
		super(entityClass, table, schema, attributesMapping, null, null );
	}
	
}
